<!--Copyright (C) Kherty.  All rights reserved.-->
<ResourceDictionary
  xmlns:ss="http://schemas.Kherty.com/office/2007/spreadsheet" 
    xmlns:ssui="clr-namespace:OpenLS.Spreadsheet.UI"
    xmlns:omedia="http://schemas.Kherty.com/office/2007/media"  
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  x:Class="OpenLS.Spreadsheet.UI.RangeResources"  
>
  <DataTemplate DataType="{x:Type ss:Range}">

    <Grid x:Name="grid" Cursor="{x:Static omedia:OfficeCursors.DragCell}" Margin="-1" Background="{x:Null}"
          MouseDown="selectionMouseDown" MouseMove="selectionMouseMove" MouseUp="selectionMouseUp" >
            <ssui:SelectionOutline x:Name="outline" Background="Black" BorderThickness="1" BorderBrush="White" HorizontalAlignment="Stretch" VerticalAlignment="Stretch "></ssui:SelectionOutline>
               <!-- <Rectangle Fill="Black" HorizontalAlignment="Stretch" VerticalAlignment="Top" Height="3"/>
      <Rectangle Fill="Black" HorizontalAlignment="Left" VerticalAlignment="Stretch" Width="3"/>
      <Rectangle Fill="Black" HorizontalAlignment="Right" VerticalAlignment="Stretch" Width="3" Margin="0 0 0 5" Name="rightLine"/>
      <Rectangle Fill="Black" HorizontalAlignment="Stretch" VerticalAlignment="Bottom" Height="3" Margin="0 0 5 0"  Name="bottomLine"/> -->
      <Label HorizontalAlignment="Right" VerticalAlignment="Bottom" Width="6" Height="6" Background="Black" BorderBrush="White"
 BorderThickness="1"                 Margin="0 0 -1 -1" MouseMove="OnFillHandleMouseMove"
                 Name="fillHandle"
        MouseDown="OnFillHandleMouseDown"  MouseUp="OnFillHandleMouseUp" MouseDoubleClick="OnFillHandleMouseDoubleClick"
        QueryCursor="OnFillHandleQueryCursor" PreviewKeyUp="OnFillHandleKey" PreviewKeyDown="OnFillHandleKey"  MouseEnter="OnFillLoaded" MouseLeave="OnFillUnloaded"/>

    </Grid>
    <DataTemplate.Triggers>
      <DataTrigger Binding="{Binding IsFullColumn}" Value="True">
        <Setter Property="VerticalAlignment" Value="Top" TargetName="fillHandle"/>
                <Setter Property="IsFullColumn" Value="True" TargetName="outline"></Setter>
                    <!--  <Setter Property="Margin" Value="0" TargetName="bottomLine"/> -->
      <!---  <Setter Property="Margin" Value="0 6 0 0" TargetName="rightLine"/> -->
      </DataTrigger>
      <DataTrigger Binding="{Binding IsFullRow}" Value="True">
        <Setter Property="HorizontalAlignment" Value="Left" TargetName="fillHandle"/>
                <Setter Property="IsFullRow" Value="True" TargetName="outline"></Setter>
                <!-- <Setter Property="Margin" Value="6 0 0 0" TargetName="bottomLine"/> -->
       <!-- <Setter Property="Margin" Value="0" TargetName="rightLine"/> -->
      </DataTrigger>
    </DataTemplate.Triggers>
  </DataTemplate>

</ResourceDictionary>